#include<iostream>
using namespace std;
struct Student {
  string name;
  int age;
  int score;
};

void printStudent1(const Student * p) {
  Student p1 = {
    "xl", 31, 100
  };
  // p->name = "xx"; 也不可以
  p = &p1;
  cout << p->age <<endl; // 31
}

void printStudent2(Student p) {
  cout << p.age <<endl; // 30
}

int main() {
  Student s1 = {"xx", 30, 100};
  printStudent1(&s1); // 引用传递
  printStudent2(s1); // 值传递
  return 0;
};
